<!--
  This template loads for the 'tab.friend-detail' state (app.js)
  'friend' is a $scope variable created in the FriendsCtrl controller (controllers.js)
  The FriendsCtrl pulls data from the Friends service (service.js)
  The Friends service returns an array of friend data
-->
<ion-view view-title="{{ticket.name}}详情" ng-init="getTicket()">
  <ion-content class="padding">
    <p>
      {{ticket.name}}
    </p>
    <p ng-bind="'票价：'+ticket.price"></p>
    <input type="number" placeholder="输入购买张数" ng-model="ticket.amount">
    <button ng-click="confirmOrder()" class="btn">生成兑换码</button>

    <button ng-click="allRedeemCode()" class="btn">查看所有兑换码</button>
    
    <ul class="qrcode">
      <li ng-repeat="code in codes">
        <p ng-bind="code.redeem_code"></p>
        <p>兑换状态：<span ng-bind="code.status=='0'?'未兑换':'已兑换'"></span></p>
        <p>二维码:<a ng-click="checkQr(code)">点击查看二维码</a></p>
        <img ng-src="{{code.qrimg}}">
      </li>
    </ul>
  </ion-content>
</ion-view>
